from mitmproxy import http

def request(flow: http.HTTPFlow) -> None:
    # 检查请求是否符合特定条件
    if "example.com" in flow.request.url:
        # 修改请求目标地址
        flow.request.host = "127.0.0.1"
        flow.request.port = 8080